﻿
namespace SistemaLogistica.Business.Logic
{
    using System;
    using System.Collections.Generic;
    using SistemaLogistica.Business.Entities;
    using SistemaLogistica.DataAccess;

    public class AreaManager
    {
        private AreaManager() { }

        private static readonly AreaManager instancia = new AreaManager();

        public static AreaManager Instancia
        {
            get { return instancia; }
        }

        public List<Area> Buscar(string nombre)
        {
            try
            {
                return AreaData.Instancia.Buscar(nombre);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public Area ObtenerPorID(int areaID)
        {
            try
            {
                return AreaData.Instancia.ObtenerPorID(areaID);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public void Agregar(Area area)
        {
            try
            {
                AreaData.Instancia.Agregar(area);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public void Modificar(Area area)
        {
            try
            {
                AreaData.Instancia.Modificar(area);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public void Eliminar(int areaID)
        {
            try
            {
                AreaData.Instancia.Eliminar(areaID);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public List<Area> Listar()
        {
            try
            {
                return AreaData.Instancia.Listar();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public List<Area> ListarPosSucursal(int sucursalID)
        {
            try
            {
                return AreaData.Instancia.ListarPorSucursal(sucursalID);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public List<Area> ListarPorAreaSuperior(int areaSuperiorID)
        {
            try
            {
                return AreaData.Instancia.ListarPorAreaSuperior(areaSuperiorID);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
